﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PServiceBus.Core.Interface;
using System.Diagnostics;

namespace PServiceBus.Core.Logger
{
	public class EventLogLogger : ILogger
	{
        private readonly string _entryName = "PServiceBus.Logs";
        #region ILogger Members

        public void Log(string text, params object[] args) {
            EventLog.WriteEntry(_entryName, String.Format(text, args));
        }

        public void Log(Exception ex) {
            EventLog.WriteEntry(_entryName, ex.ToString(), EventLogEntryType.Error);
        }

        #endregion
    }
}
